const router = require('koa-router')()
const myGoods = require('../api/myGoods')
router.prefix('/myGoods')
// #region
/**
 * @swagger
 * /myGoods/list 根据二级分类id查询我的商品列表:
 *   post:
 *     description: 根据二级分类id查询我的商品列表
 *     tags: [商品模块]
 *     produces:
 *       - application/json
 *     parameters:
 *       - name: categoryTwoId
 *         description: 二级分类id
 *         in: formData
 *         required: true
 *         type: number
 *       - name: page
 *         description: 页码
 *         in: formData
 *         required: true
 *         type: number
 *       - name: size
 *         description: 页数
 *         in: formData
 *         required: true
 *         type: number
 *       - name: value
 *         description: 商品名字关键词模糊搜索
 *         in: formData
 *         required: false
 *         type: number
 *     responses:
 *       0:
 *         description: 成功
 *         schema:
 *           type: object
 *           $ref: '#/definitions/success'
 *       -1:
 *         description: 失败
 *         schema:
 *           type: object
 *           $ref: '#/definitions/fail'
 */
// #endregion
router.post('/list', myGoods.myGoodsList)
// #region
/**
 * @swagger
 * /myGoods/detail 根据商品id查询商品详情:
 *   post:
 *     description: 根据商品id查询商品详情
 *     tags: [商品模块]
 *     produces:
 *       - application/json
 *     parameters:
 *       - name: goodsId
 *         description: 商品id
 *         in: formData
 *         required: true
 *         type: number
 *     responses:
 *       0:
 *         description: 成功
 *         schema:
 *           type: object
 *           $ref: '#/definitions/success'
 *       -1:
 *         description: 失败
 *         schema:
 *           type: object
 *           $ref: '#/definitions/fail'
 */
// #endregion
router.post('/detail', myGoods.myGoodsDetail)
router.post('/modify', myGoods.myGoodsModify)

module.exports = router